home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
wmail230.zip
/
WNODE220.ARJ
/
WNLDEMO.PAS
next >
Wrap
Pascal/Delphi Source File
|
1992-12-28
|
4KB
|
153 lines
Program WNLDemo;
{ Demo program for unit WNodelst.pas - See WNodelst.pas for reference }
Uses
Crt,WNodelst;
Procedure Split_Address(Address:String;Var Zone,Net,Node,Point:Integer);
Var
MomStr:String[5];
Begin
Address:=Word_UpCase(Address);
If Copy(Address,1,3)='ALL' then
Begin
Zone:=-1;Net:=-1;Node:=-1;Point:=-1;
end
else
Begin
Address:=Address+' ';
Zone:=Val2(Copy(Address,1,Pos(':',Address)-1));
If Zone=0 then
Zone:=2;
Delete(Address,1,Pos(':',Address));
If copy(Address,1,3)='ALL' then
Begin
Net:=-1;
Node:=-1;
Point:=-1;
end
else
Begin
If Pos('/',Address)<>0 then
Net:=Val2(Copy(Address,1,Pos('/',Address)-1));
Delete(Address,1,Pos('/',Address));
If Pos('.',Address)<>0 then
Begin
Node:=Val2(Copy(Address,1,Pos('.',Address)-1));
If Address[1]='.' then
Begin
Net:=0;
Node:=0;
end;
Delete(Address,1,Pos('.',Address));
Point:=Val2(Copy(Address,1,Pos(' ',Address)-1));
end
else
Begin
MomStr:=Copy(Address,1,Pos(' ',Address)-1);
If MomStr='ALL' then
Node:=-1
else
Node:=Val2(MomStr);
Point:=0;
end
end
end
end;
Var
SysStr:String;
Find:FindNodeRec;
Zona,Net,Nodo,Point:Integer;
Ok:Boolean;
FlagStr:String;
Found:Integer;
Begin
Ok:=InitNodeList('d:\fd\nodelist'); { Place here your directory }
If Ok then
Repeat
ClrScr;
Writeln('Simple test program for W-Nodelist');
Writeln;
Writeln('1 - Search by Sysop''s name (FindFirstSysop)');
Writeln('2 - Search by address (FindFirstNode)');
Writeln('3 - Non-indexed search by flag');
Writeln('X - Exit');
Writeln;
Write('Selection (1,2,3,X):');
Readln(SysStr);
If SysStr='1' then
Begin
Write('Sysop''s name (or initial part of it):');
Readln(SysStr);
FindFirstSysop(SysStr,Find);
With Find.BBSRecord do
While SysopName<>'' do
Begin
Write(SysopName,' on ');
Writeln(Zone,':',Net,'/',Node,'.',Point,' - ',BBSName);
Writeln('Speed:',BaudRate,' Flags:',Flags);
FindNextSysop(Find);
end;
Writeln('End of list. Press enter for more.');
Readln;
end
else
If SysStr='2' then
Begin
Write('Address (''ALL'' macros are ammitted):');
Readln(SysStr);
Split_Address(SysStr,Zona,Net,Nodo,Point);
FindFirstNode(Zona,Net,Nodo,Point,Find);
With Find.BBSRecord do
While SysopName<>'' do
Begin
Write(SysopName,' on ');
Writeln(Zone,':',Net,'/',Node,'.',Point,' - ',BBSName);
Writeln('Speed:',BaudRate,' Flags:',Flags);
FindNextNode(Find);
end;
Writeln('End of list. Press enter for more.');
Readln;
end
else
If SysStr='3' then
Begin
Write('Write the flag you want to look for:');
Readln(SysStr);
Found:=0;
SysStr:=Word_UpCase(SysStr);
FindFirstNode(All,0,0,0,Find);
With Find.BBSRecord do
While SysopName<>'' do
Begin
FlagStr:=','+Flags+',';
If Pos(SysStr,','+FlagStr+',')<>0 then
Begin
Write(SysopName,' on ');
Writeln(Zone,':',Net,'/',Node,'.',Point,' - ',BBSName);
Writeln('Speed:',BaudRate,' Flags:',Flags);
Inc(Found);
If Found mod 12=0 then
Begin
Write('More...');
Readln;
Writeln;
end;
end;
FindNextNode(Find);
end;
Writeln('There are ',Found,' nodes with ',SysStr,' flag.');
Writeln('End of list. Press enter to continue.');
Readln;
end;
Until SysStr[1] in ['X','x']
else
Writeln(#7+'Check your nodelist files!');
CloseNodeListFiles;
ClrScr;
end.